package fr.neyb.bernouilli.problem018;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class UnmodifiableNode extends Node {

	public UnmodifiableNode(int value, Set<Node> parents, Set<Node> children) {
		super(value, Collections.unmodifiableSet(new HashSet<>(parents)),
				Collections.unmodifiableSet(new HashSet<>(children)));
	}

	public UnmodifiableNode(Node n) {
		this(n.getValue(), Collections.unmodifiableSet(new HashSet<>(n
				.getParents())), Collections.unmodifiableSet(new HashSet<>(n
				.getChildren())));
	}
}
